# -*- coding: utf-8 -*-

from functools import partial

from w.blocks.block import BaseBlock as Block
from w.blocks.containers.button import BaseButton as BaseButtonContainer

class Error(Exception):
    pass

class BaseButton(BaseButtonContainer, Block):
    scriptFiles = ['w/blocks/basebutton.js']

    def __init__(self, *argv, **kwargv):
        BaseButtonContainer.__init__(self, *argv, **kwargv)
        Block.__init__(self, *argv, **kwargv)

        self.tag.html.id='dom%s'%self.blockID

    def make(self):
        return Block.make(self, BaseButtonContainer.make(self))

Button = partial(BaseButton, htype='button')
OKButton = partial(BaseButton, htype='submit')
ClearButton = partial(BaseButton, htype='reset')
